package gov.tax.rti.base.security.service.impl;

import gov.tax.rti.base.security.entity.Gnbq;
import gov.tax.rti.base.security.service.GnbqCacheService;
import gov.tax.rti.base.security.service.GnbqService;
import gov.tax.rti.core.security.service.SecurityCacheService;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.googlecode.ehcache.annotations.Cacheable;
import com.googlecode.ehcache.annotations.TriggersRemove;

/**
 * 功能标签业务缓存实现类
 * 
 * @since 2013年11月11日
 * @author jimmy.li
 * @version 1.00 2013年11月11日
 */
@Service
public class GnbqCacheServiceImpl implements GnbqCacheService {

	@Resource
	private GnbqService gnbqService;
	@Resource
	private SecurityCacheService securityCacheService;
	
	@TriggersRemove(cacheName = {"rti.base.gnbq"}, removeAll = true)
	public void clearGnbqCache() {
		securityCacheService.clearFunctionCache();
	}
	
	@Override
	@Cacheable(cacheName = "rti.base.gnbq")
	public List<Gnbq> getAllGnbq() {
		return gnbqService.getAllGnbq();
	}

}
